<template>
  <span :value="value">{{ filterMap }}</span>
</template>

<script>
import { mapGetters } from 'vuex'
export default {
  name: 'Filtercode',
  props: {
    value: [String, Number],
    type: [String, Number]
  },
  data() {
    return {
      dicmap: []
    }
  },

  computed: {
    filterMap() {
      this.dicmap = this.dictMap[this.type]
      for (let i = 0; i < this.dicmap.length; i++) {
        if (isNaN(Number(this.value))) {
          return this.value
        } else if (Number(this.value) === this.dicmap[i].code_id) {
          return this.dicmap[i].code_cn_desc
        }
      }
    },
    ...mapGetters(['dictMap'])
  },

  methods: {}
}
</script>

<style scoped>
</style>
